﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>活动报名</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/Base/BaseClass.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script type="text/javascript" src="/JqueryPlug/layer/layer/layer.js"></script>
    <script src="/Scripts/SZHLCommon.js"></script>
    <script>
        var model = avalon.define({
            $id: "HDBM",
            CommonData: [],
            SearchContent: "",
            HDBMType: "0",
            AddHDBM: function () {
                parent.ComFunJS.winviewform("/View/APPBaseView/APP_ADD.html?FormCode=HDBMADD&FrameName=frameHDBM", "添加数据", "1100", "600");
            },
            GetHDBMDataList: function () {
                $.getJSON('/API/FTAPI.ashx?Action=GETUSERHDBMLIST', { P1: model.SearchContent, P2: model.HDBMType }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.CommonData = resultData.Result;
                    }
                })

            },
            AddHDBMItem: function (item) {
                parent.ComFunJS.winviewform("/View/APPBaseView/APP_ADD.html?FormCode=HDBMITEMADD&ID=" + item.ID, "报名", "680", "350");
            },
            HDBMItemView: function (ID) {
                parent.ComFunJS.winviewform("/View/APPBaseView/APP_HDBM_ItemView.html?ID=" + ID, "查看已报名人员", "1000", "600");
            },
            AddPL: function (item, dom) {
                var plcontent = dom.val();
                if ($.trim(plcontent) == "") {
                    parent.ComFunJS.winwarning("请输入批注内容");
                    return;
                }
                $.post('/API/FTAPI.ashx?Action=ADDCOMENT', { "P1": plcontent, "MsgType": "HDBM", "MsgLYID": item.ID }, function (result) {
                    var result = $.parseJSON(result);
                    if (result.ErrorMsg == "") {
                        item.PLList.push(result.Result)
                        dom.val("")
                    }
                })
            },
            jptj: function (event, item, dom) {
                if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10)) {
                    model.AddPL(item, dom);
                }
            },
        });
        avalon.ready(function () {
            model.GetHDBMDataList();
        })
        $(document).ready(function () {
            $(".hidPan").click(function () {
                $(this).parent().find(".panel-body,.panel-footer").toggle('normal')
            })
        });
    </script>
</head>
<body ms-controller="HDBM">
    <div class="container-fluid maindiv" style="margin-top: 20px" id="dvContent">
        <div style="width:200px;position:absolute">
            <div class="panel panel-default">
                <div class="panel-body text-center">
                    <a href="#" id="btADD" ms-click="AddHDBM()" style=" height: 34px;line-height: 34px;" class="button button-glow button-border button-rounded button-primary"><i class="fa fa-plus"></i>添加活动</a>
                </div>
            </div>
            <div class="list-group ">
                <a href="/View/APPBaseView/APP_HDBM.html" class="list-group-item active" style="padding-left: 15px"><span class="glyphicon glyphicon-list"></span>&nbsp;&nbsp;活动报名</a>
            </div>
        </div>
        <div class="row contentdv" style="margin-left:201px">
            <div class="col-xs-12 ">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-xs-10">
                                <div class="input-group">
                                    <div class="input-group-addon">查询条件</div>
                                    <select class="form-control" ms-attr-change="GetHDBMDataList()" style="width:30%" ms-duplex="HDBMType">
                                        <option value="0">全部状态</option>
                                        <option value="1">正在进行</option>
                                        <option value="2">已结束</option>
                                    </select>
                                    <input id="tbSearch" class="form-control" style="width:70%" ms-duplex="SearchContent" type="text" placeholder="输入活动内容或标题查询" />
                                    <span class="input-group-btn">
                                        <button class="btn btn-info"  ms-click="GetHDBMDataList()">查询</button>
                                    </span>
                                </div>
                            </div>
                            <div class="col-xs-2">
                            </div>

                        </div>
                    </div>

                </div>
                <div class="panel panel-default" ms-repeat-item="CommonData">
                    <div class="panel-heading hidPan">
                        <span class="glyphicon glyphicon-minus"></span><span class="panel-title">
                            &nbsp;【发起方：{{item.HDFQF}}】{{item.HDTitle}}<span class="label label-danger" style="border-radius: 25PX;" ms-if="ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == 0||ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == -1">新!</span>            <span class="pull-right">{{item.CRDate|date("yyyy-MM-dd")}}[by{{ComFunJS.convertuser(item.CRUser)}}]</span> <!--ms-if-->
                        </span>
                    </div>
                    <div class="panel-body">
                        <blockquote>
                            <p ms-html="item.HDContent"></p>
                            <footer>活动内容 </footer>
                        </blockquote>
                        <div class="row">
                            <div class="col-xs-4">
                                <blockquote>
                                    <p>{{item.HDAdress}}</p>
                                    <footer>活动地址 </footer>
                                </blockquote>
                            </div>
                            <div class="col-xs-4">
                                <blockquote>
                                    <p>{{item.HDTime|date("yyyy-MM-dd")}}</p>
                                    <footer>活动时间 </footer>
                                </blockquote>
                            </div>
                            <div class="col-xs-4">
                                <blockquote>
                                    <p>{{item.HDBMEndTime|date("yyyy-MM-dd")}}</p>
                                    <footer>报名截至时间 </footer>
                                </blockquote>
                            </div> 
                                <label ms-if="item.FileList!=null&&item.FileList.size()>0" style=" margin-left:20px;"> 附件：</label><a style="margin-left:10px" ms-repeat-files="item.FileList" target="_blank" download="filename" ms-attr-href="ComFunJS.FilePathAPI+files.FileMD5">{{files.Name+'.'+files.FileExtendName}}</a>
                         
                        </div>

                        <button class="btn btn-info" ms-click="AddHDBMItem(item)" ms-if="ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.HDBMEndTime.substring(0,10)) == 0||ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.HDBMEndTime.substring(0,10)) == -1"> {{item.itemUser==""||item.itemUser==null?"我要报名":"已报名"}}</button><a href="#" style="margin-left:10px" ms-click="HDBMItemView(item.ID)">查看已报名人员</a>
                    </div>
                    <div class="panel-footer Yan-HidPanBody" style="overflow: hidden;">
                        <div class="chat-widget" style="margin-top: 10PX; margin-bottom: 40px">
                            <ul class="list-unstyled">
                                <!--ms-repeat-start-->
                                <!--repeat498387512983754309602854494005442-->
                                <li class="by-me Yan-comment" ms-repeat-el="item.PLList">
                                    <div class="avatar" style="float: left">
                                        <img alt="" src="../../images/i07.png">
                                    </div>
                                    <div class="chat-content">
                                        <div class="chat-meta">{{el.CRUserName}} <span style="float: right"><!--ms-if-->{{el.CRDate|date("MM月dd日 HH:mm")}}</span></div>
                                        {{el.MSGContent}}
                                        <div class="clearfix"></div>
                                    </div>
                                </li><!--repeat498387512983754309602854494005442-->
                            </ul>
                        </div>
                        <div class="input-group">
                            <input class="form-control" type="text" ms-keypress="jptj(event,item,$(this))" placeholder="此处添加批注(按Ctrl+Enter直接提交)" />
                            <span class="input-group-btn">
                                <button type="button" data-loading-text="正在保存..." class="btn  btn-info addTL" autocomplete="off" ms-on-click="AddPL(item,$(this).parent().parent().find('input'))">
                                    添加批注
                                </button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
</body>
</html>
